A Type System for Preventing Data Races and Deadlocks in the Java Virtual Machine Language
نویسندگان
چکیده
In previous work on SafeJava we presented a type system extension to the Java source language that statically prevents data races and deadlocks in multithreaded programs. SafeJava is expressive enough to support common programming patterns, its type checking is fast and scalable, and it requires little programming overhead. SafeJava thus offers a promising approach for making multithreaded programs more reliable. This paper presents a corresponding type system extension for the Java virtual machine language (JVML). We call the resulting language SafeJVML. Welltyped SafeJVML programs are guaranteed to be free of data races and deadlocks. Designing a corresponding type system for JVML is important because most Java code is shipped in the JVML format. Designing a corresponding type system for JVML is nontrivial because of important differences between Java and JVML. In particular, the absence of block structure in JVML programs and the fact that they do not use named local variables the way Java programs do make the type systems for Java and JVML significantly different. For example, verifying absence of races and deadlocks in JVML programs requires performing an alias analysis, something that was not necessary for verifying absence of races and deadlocks in Java programs. This paper presents static and dynamic semantics for SafeJVML. It also includes a proof that the SafeJVML type system is sound and that it prevents data races and deadlocks. To the best of our knowledge, this is the first type system for JVML that statically ensures absence of synchronization errors.
منابع مشابه
A Type System for Preventing Data Races and Deadlocks in Java Programs
This paper presents a new static type system for multithreaded programs; well-typed programs in our system are guaranteed to be free of data races and deadlocks. Our type system allows programmers to partition the locks into a fixed number of equivalence classes and specify a partial order among the equivalence classes. The type checker then statically verifies that whenever a thread holds more...
متن کاملSafe Runtime Downcasts With Ownership Types
The possibility of aliasing between objects constitutes one of the primary challenges in understanding and reasoning about correctness of object-oriented programs. Ownership types provide a principled way of specifying statically enforcable restrictions on object aliasing. Ownership types have been used to aid program understanding and evolution, verify absence of data races and deadlocks in mu...
متن کاملOutput-Deterministic Replay for Multicore Debugging
Reproducing bugs is hard. Deterministic replay systems aim to address this problem, by providing a high-fidelity replica of an original program execution that can be repeatedly executed to zero-in on bugs. Unfortunately, existing replay systems for multiprocessor programs fall short. These systems either incur high overheads, rely on nonstandard multiprocessor hardware, or fail to reliably repr...
متن کاملProbabilistic Model Checking with Java PathFinder?
On the one hand, probabilistic model checkers such as PRISM [1] have been successfully employed to verify models of probabilistic systems. However, they are not suitable for checking properties such as uncaught exceptions of the actual code of the system. On the other hand, model checkers such as Java PathFinder (JPF) [2] have been used with success to verify actual code of systems. However, th...
متن کاملA Race and Transaction-Aware Runtime for Java
Data races often result in unexpected and erroneous behavior. In addition to causing data corruption and possibly program crash, the presence of data races complicates the semantics of an execution which might no longer be sequentially consistent. Motivated by these observations, we have designed and implemented a Java runtime system that monitors program executions and throws a DataRaceExcepti...
متن کامل